// React 路由懒加载
import Loadable from 'react-loadable'
import { Spin } from 'antd'
function LoadingBox() {
    return (
        <div
            style={{
                width: '100%',
                height: '100%',
                display: 'flex',
                justifyContent: 'center',
                alignItems: 'center'
            }}
        >
            <Spin size='large' tip='加载中...' />
        </div>
    )
}
const Lazyload = (lazyComponent, loading = LoadingBox) => Loadable({ loader: lazyComponent, loading })
export default Lazyload